package com.gf.pokemon.constants;

import com.gf.pokemon.platform.exception.PokeErrorCode;
import com.gf.pokemon.platform.exception.PokeException;

public enum IsInput {
	NO(0),
	YES(1);
	
	private Integer type;
	
	private IsInput(Integer type){
		this.type = type;
	}
	
	public Integer getType(){
		return type;
	}
	
	public static IsInput parse(Integer type) throws PokeException{
		for(IsInput isInput:IsInput.values()){
			if(isInput.getType().equals(type)){
				return isInput;
			}
		}
		throw new PokeException(PokeErrorCode.INVALID_PARAM,"错误的数字输入类型，仅支持0不需要数字输入和1需要数字输入");
	}
}
